package cn.xiaye.blog.servlet;

import cn.xiaye.blog.bean.Context;
import cn.xiaye.blog.dao.UserDao;
import cn.xiaye.blog.db.util.CommonUtil;

@SuppressWarnings("serial")
public class DeleteUser extends FatherServlet {

	@Override
	public String excute(Context context) {
		if(!CommonUtil.isLogin(context.getSession())){
			return "login.jsp";
		}
		String userId = context.getRequest().getParameter("user_id");
		UserDao userDao = new UserDao();
		userDao.deleteById(Integer.valueOf(userId));
		return "ShowUserPage";
	}

}
